#pragma once

#include <linux/thread_info.h>

static inline void set_preempt_need_resched(void)
{
}

static inline void __preempt_count_add(int type, int val)
{
    struct thread_info *ti = current_thread_info();

    switch (type)
    {
    case 0:
        ti->preempt.preempt += val;
        break;
    case 2:
        ti->preempt.hardirq += val;
        break;
    }
}

static inline unsigned int preempt_count(void)
{
    return current_thread_info()->preempt.val[0];
}

static inline void preempt_count_set(int pc)
{
    current_thread_info()->preempt.val[0] = pc;
}
